home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
dev
/
gcc
/
libmat.lha
/
libmat.doc
next >
Wrap
Text File
|
1980-01-01
|
2KB
|
74 lines
Libmat.a
Introduction:
A matrix classlibrary for gcc(other C++ compilers may work too).
OBS! This is VERY beta it might not always work.
Copyright: GLPL(included)
Installation:
Copy matrix.h to gnu:lib/g++-include and the libs to gnu:lib.
Usage:
gcc <what-ever-prog> -lmat -lm
or
gcc <what-ever-prog> -lmatC -lm
for dimension check.
or
gcc <what-ever-prog> -lmatDC -lm
for dimensioncheck and function trace(in swedish:)).
Recompiling:
Just cd to the dir and type make(copy matrix.h to lib/g++-include first!).
Doc:
Operators and functions:
+ - * /
inv(A) :inverts the matrix A same as 1/A,det(A)!=0,dim(A)= nxn.
eigen(A) :Returns the eigenvalues for A,dim(A)=nxn.if A has complex eigenvalues this creates an
infinit loop:-(.
solve(A,b): Solves the linear eq. A*x=b,dim(A)=nxn,Dim(b)=nx1.
LR(A,L,R) : L-R factors the matrix A.
e(n,x) :Returns a vector with dim nx1 with a "1" in element x.
I(n) :Returns a matrix ,with dim nxn,with ones on the diagonal.
det(A):Returns the determinant for A,dim(A)=nxn.
Methods:
read: Reads a matrix from stdin.
print:prints a matrix to stdout.
ex:
Matrix A(2,2);
A.read(); // read a 2x2 matrix from stdin.
A.print();// and print it.
Constructors:
Matrix(float **a,int x ,int y)
Matrix created with same coffs as a with dim x,y.
Matrix(int x,int y)
Creates a zeromatrix with dim x y.
Matrix(int x)
Creates a zeromatrix with dim x x.
Matrix(const Matrix &A)
Creates an identical copy of A.
Matrix(const Matrix &A,int x,int y)
Creates of copy of A with dim x y.
Matrix()
Creates an empty matrix.
Comments to:
Tommy Johansson
StΣrng1 1 NB
72468 VΣsterσs
Sweden
email: frv95tjn@mds.mdh.se